package com.xsy.android.compose.wandroid.ui.page.home.view

import android.util.Log
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.paging.compose.LazyPagingItems
import com.xsy.android.compose.wandroid.logic.model.ArticleModel
import com.xsy.android.compose.wandroid.logic.model.BannerBean
import com.xsy.android.compose.wandroid.ui.page.artice.list.ArticleListPaging
import com.zj.banner.BannerPager
import com.zj.banner.ui.config.BannerConfig

/**
 *@author: xiaosy
 *时间: 2024/7/11
 *@Description: java类作用描述
 *@Version: 1.0
 **/
@Composable
fun HomeContent(
    modifier: Modifier = Modifier,
    data: List<BannerBean>,
    articleModifier: Modifier = Modifier,
    lazyPagingItems: LazyPagingItems<ArticleModel>,
    toArticleModel: (ArticleModel) -> Unit
) {
    val listState = rememberLazyListState()
    Log.d("HomContent", "data->$data")
//    BannerPager(items = data, config = BannerConfig(repeat = false), modifier = modifier) {
//        toArticleModel(
//            ArticleModel(title = it.title, link = it.url)
//        )
//    }
    ArticleListPaging(
        modifier = articleModifier,
        listState = listState,
        lazyPagingItems = lazyPagingItems,
        enterArticle = toArticleModel
    )

}